package com.weixin.stream;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @ClassName StreamTest
 * @Description Stream流
 * @date 2022/2/21 16:23
 * @author: wx
 * @Version 1.0
 */
public class StreamTest {

    @Test
    public void test(){
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(12);
        List<Integer> finaList = list.stream().map(integer -> {
           return integer +=1;
        }).collect(Collectors.toList());

        for(Integer i : finaList){
            System.out.println(i);
        }
    }
}
